Skip to content

Conversation

@akomelj
Copy link

@akomelj akomelj commented Jul 12, 2025

This pull request adds new parameter device to method ping. The parameter allows to explicitly specify the name of the device to bind outgoing ICMP socket to.

Setting a socket source address (parameter source) does not always select the correct network interface as the interface is selected based on (destination) routing rules which may not favour the intended interface for a given destination IP. It is technically possible to define a source based routing policy to select the interface based on the socket source address but this requires much more effort than simply specifying the device name and setting socket option SOL_SOCKET, SO_BINDTODEVICE.

Additionally, the pull request adds a missing pydoc parameter description and updates the pydoc parameter name to match the actual code parameter name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant